<h2> Product Details</h2>
<?php
$this->headTitle('Product Details');
$this->headScript()->appendFile('/js/BizSense/Product/Delete.js');   
$product = $this->product->toArray();
$productId = $this->escape($product['product_id']);
$acl = $this->acl;
?>
<?php if ($acl->isAllowed($this->currentUser, 'access product pages')): ?>
<a href="<?php echo $this->url(
    array(
        'module' => 'default',
        'controller' => 'product',
        'action' => 'index',
    ), null, true); ?>">Products
</a> |
<?php endif; ?>

<?php if ($acl->isAllowed($this->currentUser, 'create products')): ?>
<a href="<?php echo $this->url(
    array(
        'module' => 'default',
        'controller' => 'product',
        'action' => 'create',
    ), null, true); ?>">Create product
</a> |
<?php endif; ?>

<?php if ($acl->isAllowed($this->currentUser, 'edit products')): ?>
<a href="<?php echo $this->url(
    array(
        'module' => 'default',
        'controller' => 'product',
        'action' => 'edit',
        'product_id' => $productId,
    ), null, true); ?>">Edit
</a> |
<?php endif; ?>

<?php if  ($acl->isAllowed($this->currentUser, 'delete products')): 
    $deleteUrl = $this->url(
                    array(
                        'module' => 'default',
                        'controller' => 'product',
                        'action' => 'delete',
                        'product_id' =>$this->escape($productId)
                    )
                );
                echo $this->deleteButton($deleteUrl); 
 endif; ?>
|

<?php if ($product['subscribable'] == 1): ?>
<?php if ($acl->isAllowed($this->currentUser, 'access product pages')): ?>
 <a href="<?php echo $this->url(
    array(
        'module' => 'default',
        'controller' => 'product',
        'action' => 'setsubscribable',
        'product_id' => $productId,
    ), null, true); ?>">Set properties
</a>|
<?php endif; ?>


<?php endif; ?>

<table class="data_table">
<tr>
<td>Service item id</td><td><?php echo $this->escape($product['product_id']); ?></td>
</tr>
<tr>
<td>Item name</td>
<td>
<?php echo $this->escape($product['name']); ?>
</td>
</tr>
<tr>
<td>Description</td><td><?php echo $this->escape($product['description']); ?></td>
</tr>
<tr>
<td>Is taxable?</td>
<td>
<?php
if ($product['taxable'] == 1) {
echo 'Taxable';
} else {
echo 'Not taxable';
}
?>
</td>
</tr>
<tr>
<td>Is subscribable?</td>
<td>
<?php
if ($product['subscribable'] == 1) {
echo 'Subscribable';
} else {
echo 'Not subscribable';
}
?>

</td>
</tr>

<tr>
<td>Selling Price</td>
<td>
<?php
echo $this->escape($product['selling_price']);
?>
</td>
</tr>

<tr>
<td>Vendor Price</td>
<td>
<?php
echo $this->escape($product['buying_price']);
?>
</td>
</tr>


<tr>
<td>Tax Type</td>
<td><?php echo $this->escape($this->taxNameById($product['tax_type_id'])); ?></td>
</tr>
<tr>
<td>Is active?</td>
<td>
<?php
if ($product['active'] == 1) {
echo 'Active';
} else {
echo 'Inactive';
}
?>
</td>
</tr>
</table>


